import 'dart:io';

import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter_juwo/ui/pages/NoticePages/NoticeDetails.dart';
import 'package:flutter_juwo/ui/pages/NoticePages/NoticeList.dart';
import 'package:flutter_juwo/ui/pages/commonProblem/CommonProblemPage.dart';
import 'package:flutter_juwo/ui/pages/messagePages/MessageDetails.dart';
import 'package:flutter_juwo/ui/pages/orderPages/Orders.dart';
import 'package:flutter_juwo/ui/pages/orderPayment/index.dart';
import 'package:flutter_juwo/ui/pages/orderPlaceProcess/OrderPlaceProcess.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/cashOut/CashOut.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/cashOut/fundsDetails.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/cashOut/incentiveDetails.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/UserInfor.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/bankCard/BankCard.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/initAccount/init.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/initAccount/list.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/initAccount/user_tags.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/invitation/Invitation.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/changePwd.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/input_invitation_code.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/login.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/register.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/setPwd.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/loginAndRegister/verify.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/memberPage/MemberPage.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/myGold/MyGoldPage.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/myGold/gold_flow.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/myMoney/MyMoneyPage.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/myMoney/moeny_flow.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/myMoney/realname_infor.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/representation/RepresentationList.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/representation/add.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/representation/detail.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/share/MyIncome.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/share/SharePage.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/share/SharePageForTs.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/ts/ts.dart';
import 'package:flutter_juwo/ui/pages/photoHero/showBigImage.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/waitReturn/WaitReturn.dart';
import 'package:flutter_juwo/ui/pages/taskPages/detail.dart';
import 'package:flutter_juwo/ui/pages/taskPages/task_step.dart';

///下单流程
var orderPlaceProcessHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return OrderPlaceProcess();
});

///支付订单
var orderPaymentHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return OrderPayment();
});


///绑定信息
var userInforHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return UserInfor();
});



///绑定银行卡
var initBankCardHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return BankCard();
});

///绑定电商平台账号  添加电商账号
var initPlatAccountHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String param1 = params['platId'].first;
  String param2 = params['id'].first;
  return InitPlatAccount(param1, param2);
});

///账户信息 账号列表
var taoListHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      String param=params['isFromTask']?.first;
  return AccountList(param);
});

///提现
var cashOutHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return CashOut();
});

///提现
var invitationHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return Invitation();
});

///奖励明细
var incentiveDetailsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return IncentiveDetails();
});

///资金明细
var fundsDetailsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return FundsDetails();
});

///公告列表
var noticeListHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return NoticeList();
});

///公告详情
var noticeDetailsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return NoticeDetails();
});

///待返
var waitReturnHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return WaitReturn();
});

///登录
var loginHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return Login();
});

///注册
var registerHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  int type = int.parse(params['type']?.first);
  return Register(type);
});

///验证码
var verifyCodeHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String path = params['phoneNum']?.first;
  int type = int.parse(params['type']?.first);
  return VerifyCode(path, type);
});

///常见问题
var commonProblemHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return CommonProblemPage();
});

///消息详情
var messageDetailsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String path = params['id']?.first;
  return MessageDetails(path);
});

///会员中心
var memberPageHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String param = params['money']?.first;
  return MemberPage(param);
});

///我的余额
var myMoneyHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return MyMoney();
});

///我的金币
var myGoldHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return MyGold();
});

///我的申述
var representationListHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return RepresentationList();
});

///申述详情
var representationDetailsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String param = params['id']?.first;
  return RepresentationDetails(param);
});

///申诉表单
var addRepresentationHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return AddRepresentation();
});

///显示大图
var showBigImageHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  File param = params['picUrl']?.first as File;

  return ShowBigImagePage(param);
});

///电商用户的标签选择页面
var userTagsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String param1 = params['arr']?.first;
  String param2 = params['platId']?.first;
  String param3 = params['id']?.first;
  return UserTagsPage(param1, param2, param3);
});

///任务列表
var orderHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  int index = int.parse(params["index"]?.first);
  return OrderPage(index);
});

///任务详情
var taskDetailHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String index = params["id"]?.first;
  return TaskDetail(index);
});

///任务步骤
var taskStepHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String index = params["id"]?.first;
  return TaskStepPage(index);
});

///推广赚钱
var shareHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return SharePage();
});

///推广赚钱
var shareTsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return SharePageForTs();
});

///推广赚钱--我的收入
var myIncomeHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return MyIncome();
});

///实名信息
var realNameInforHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return RealNameInfor();
});

///资金流水
var moneyFlowHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return MoneyFlow();
});

///金币流水
var goldFlowHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return GoldFlow();
});

///我是推手
var tsHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  int index = int.parse(params["index"]?.first);
  return Ts(index);
});

///设置密码
var setPwdHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  int type = int.parse(params['type']?.first);
  String tel = params['tel']?.first;
  String smsCode = params['smsCode']?.first;
  return SetPwd(type, tel, smsCode);
});

///输入邀请码
var inputInvitationCodeHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return InputInvitationCode();
});

///修改密码
var changePwdHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  return ChangePwd();
});
